#include <stdio.h>
#include <signal.h>

int flag = 0;
void handler(int signal)
{
  flag = 1;
  printf("flag had change,signal is:%d\n",signal);
}

int main()
{
  signal(2,handler);
  while(!flag)
  {
    printf("process is running\n");
  }
  return 0;
}
